package com.adcc.ags.msgStore;

import com.fasterxml.jackson.annotation.JsonProperty;

import javax.validation.constraints.Max;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull;

/**
 * MQ连接配置工厂
 */
public class MQConnectionFactory {
    //MQ IP地址
    @NotNull
    private String ip;
    //队列管理器
    @NotNull
    private String queueManager;
    // MQ 端口
    @NotNull
    private Integer port;
    // 接收消息队列
    @NotNull
    private String recQueueName;
    // 接收管道
    @NotNull
    private String recChannelName;


    // ActiveMode
    @Min(0)
    @Max(2)
    private int activeMode;

    // 连接超时时间
    @Min(0)
    @Max(3600000)
    private long timeout;

    // 最大连接数
    @Min(0)
    @Max(9192)
    private int maxConnections;

    // 最大空闲连接数
    @Min(0)
    @Max(2048)
    private int maxIdelConnections;

    @JsonProperty("ip")
    public String getIp() {
        return ip;
    }

    @JsonProperty("ip")
    public void setIp(String ip) {
        this.ip = ip;
    }

    @JsonProperty("queueManager")
    public String getQueueManager() {
        return queueManager;
    }

    @JsonProperty("queueManager")
    public void setQueueManager(String queueManager) {
        this.queueManager = queueManager;
    }

    @JsonProperty("port")
    public Integer getPort() {
        return port;
    }

    @JsonProperty("port")
    public void setPort(Integer port) {
        this.port = port;
    }

    @JsonProperty("recQueueName")
    public String getRecQueueName() {
        return recQueueName;
    }

    @JsonProperty("recQueueName")
    public void setRecQueueName(String recQueueName) {
        this.recQueueName = recQueueName;
    }

    @JsonProperty("recChannelName")
    public String getRecChannelName() {
        return recChannelName;
    }

    @JsonProperty("recChannelName")
    public void setRecChannelName(String recChannelName) {
        this.recChannelName = recChannelName;
    }

    @JsonProperty("activeMode")
    public int getActiveMode() {
        return activeMode;
    }

    @JsonProperty("activeMode")
    public void setActiveMode(int activeMode) {
        this.activeMode = activeMode;
    }

    @JsonProperty("timeout")
    public long getTimeout() {
        return timeout;
    }

    @JsonProperty("timeout")
    public void setTimeout(long timeout) {
        this.timeout = timeout;
    }

    @JsonProperty("maxConnections")
    public int getMaxConnections() {
        return maxConnections;
    }

    @JsonProperty("maxConnections")
    public void setMaxConnections(int maxConnections) {
        this.maxConnections = maxConnections;
    }

    @JsonProperty("maxIdelConnections")
    public int getMaxIdelConnections() {
        return maxIdelConnections;
    }

    @JsonProperty("maxIdelConnections")
    public void setMaxIdelConnections(int maxIdelConnections) {
        this.maxIdelConnections = maxIdelConnections;
    }
}
